#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 100+10, INF = 0x3f3f3f3f;
ll a[N], d[N][N][N], s[N];
int n, l, r;
int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    while (cin >> n >> l >> r){
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
            s[i] = a[i] + s[i-1];
        }
        memset(d, INF, sizeof d);
        for(int i=1; i<=n; ++i) d[i][i][1] = 0;
        for (int len = 2; len <= n ; ++len) {
            for (int i = 1; i <= n ; ++i) {
                int j = i+len-1;
                if(j > n) break;
                for (int k = 2; k <= len&&k<=r; ++k) {
                    ll & ans = d[i][j][k];
                    for (int p = i; p <= j-1 ; ++p) {
                        ans = min(ans, d[i][p][k-1] + d[p+1][j][1]);
                    }
                    if(k >=l && k<=r){
                        ll & ans2 = d[i][j][1];
                        ans2 = min(ans2, d[i][j][k] + s[j] - s[i-1]);
                    }
                }
            }
        }

        cout << (d[1][n][1]<INF? d[1][n][1]:0) << endl;
    }
    return 0;
}